home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
puppy_red.swf
/
scripts
/
DefineSprite_46_enermy
/
frame_1
/
PlaceObject2_21_10
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2008-03-11
|
3KB
|
81 lines
onClipEvent(enterFrame){
if(!_global.dead)
{
if(fly == 0)
{
firedelay = Math.floor(getTimer() / 1000) - enstartpo;
if(firedelay >= firetime)
{
if(angle > - randangle)
{
this.angle--;
posin2._rotation = - angle;
}
if(angle < - randangle)
{
this.angle = this.angle + 1;
posin2._rotation = - angle;
}
poz.attachMovie("enpo",po,1);
posin2._rotation = - angle;
poz[po]._rotation = - angle;
poz[po]._x = 0;
poz[po]._y = 0;
startx = poz[po]._x;
starty = poz[po]._y;
poz[po]._alpha = 0;
v = random(70) - 100;
posin2.play();
}
}
if(angle == - randangle && posin2.balsa == 1)
{
fly = 1;
t += 0.15;
vy0 = v * Math.sin(angle * 3.141592653589793 / 180);
vx0 = v * Math.cos(angle * 3.141592653589793 / 180);
vy = vy0 - gravitation * t;
poz[po]._x = (startx + vx0 * t) * 1.5;
poz[po]._y = (starty - vy0 * t + 0.5 * gravitation * t * t) * 1.5;
poz[po]._alpha = 100;
if(poz[po]._y >= 45)
{
mispozx = poz[po]._x;
mispozy = poz[po]._y;
tankpozx = _parent._x;
tankpozy = _parent._y;
if(poz[po].hitTest(_parent._parent.rand))
{
p++;
_parent._parent.attachMovie("randmiss",randmiss,40000 + p);
_parent._parent[randmiss]._x = mispozx + tankpozx;
_parent._parent[randmiss]._y = mispozy + tankpozy;
poz[po].removeMovieClip();
t = 0;
fly = 0;
posin2.balsa = 0;
enstartpo = Math.floor(getTimer() / 1000);
randangle = random(70) + 10;
firetime = random(4) + 1;
v = 0;
}
else
{
p++;
_parent._parent.attachMovie("miss",miss,40000 + p);
_parent._parent[miss]._x = mispozx + tankpozx - 10;
_parent._parent[miss]._y = mispozy + tankpozy;
poz[po].removeMovieClip();
t = 0;
fly = 0;
posin2.balsa = 0;
enstartpo = Math.floor(getTimer() / 1000);
randangle = random(70) + 10;
firetime = random(4) + 1;
v = 0;
}
}
}
}
}